package com.admin.utils.server;


import com.admin.utils.arith.Arith;

/**
 * 內存相关信息
 * @author kuaiting
 */
public class Mem
{
    /**
     * 内存总量
     */
    private String total;

    /**
     * 已用内存
     */
    private String used;

    /**
     * 剩余内存
     */
    private String free;

    public String getTotal()
    {
        return Arith.div(total, (1024 * 1024 * 1024)+"", 2);
    }

    public void setTotal(String total)
    {
        this.total = total;
    }

    public String getUsed()
    {
        return Arith.div(used, (1024 * 1024 * 1024)+"", 2);
    }

    public void setUsed(String used)
    {
        this.used = used;
    }

    public String getFree()
    {
        return Arith.div(free, (1024 * 1024 * 1024)+"", 2);
    }

    public void setFree(String free)
    {
        this.free = free;
    }

    public String getUsage()
    {
        return Arith.mul(Arith.div(used, total, 4), "100");
    }
}
